//
//  GWDiscoverViewController.m
//  新浪微博
//
//  Created by qianfeng on 16/1/9.
//  Copyright (c) 2016年 高炜. All rights reserved.
//

#import "GWDiscoverViewController.h"
#import "GWMySearchBar.h"
#import "GWDiscoverItemGroup.h"
#import "GWDiscoverItem.h"
#import "GWDiscoverCell.h"
#import "GWCommonIArrowtem.h"
#import "GWCommonSwitchItem.h"
#import "GWCommonLabelItem.h"
#import "GWtestView.h"
@interface GWDiscoverViewController ()
@end

@implementation GWDiscoverViewController
- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    GWMySearchBar *textField =[GWMySearchBar searchBar];
    textField.size =CGSizeMake(self.view.width-20, 30);
    self.navigationItem.titleView =textField;
    
    
    [self addGroup0];
    [self addGroup1];
    [self addGroup2];
    
    
}
-(void)addGroup0
{
    GWDiscoverItemGroup *group =[[GWDiscoverItemGroup alloc]init];
    
    GWCommonIArrowtem *hotStatuse =[GWCommonIArrowtem itemWithIcon:@"hot_status" Title:@"热门微博"];
    hotStatuse.subleTitle =@"笑话，娱乐，神之右都搬到这里啦";
    
    GWDiscoverItem *findPeople =[GWDiscoverItem itemWithIcon:@"find_people" Title:@"找人"];
    findPeople.subleTitle =@"名人、有意思的人尽在这里";
    group.items =@[hotStatuse,findPeople];
    [self.itemGroups addObject:group];
}
-(void)addGroup1
{
    GWDiscoverItemGroup *group =[[GWDiscoverItemGroup alloc]init];
    GWCommonSwitchItem *video =[GWCommonSwitchItem itemWithIcon:@"video" Title:@"视频"];
    GWCommonIArrowtem *music =[GWCommonIArrowtem itemWithIcon:@"music" Title:@"音乐"];
    GWCommonLabelItem *movie =[GWCommonLabelItem itemWithIcon:@"movie" Title:@"电影"];
    movie.labelText =@"哈哈哈";
    GWDiscoverItem *cast =[GWDiscoverItem itemWithIcon:@"cast" Title:@"播客"];
    cast.bageValue =@"998";
    GWDiscoverItem *more =[GWDiscoverItem itemWithIcon:@"more" Title:@"更多"];
    group.items =@[video,music,movie,cast,more];
    [self.itemGroups addObject:group];
}
-(void)addGroup2
{
    GWDiscoverItemGroup *group =[[GWDiscoverItemGroup alloc]init];
    GWDiscoverItem *game_center =[GWDiscoverItem itemWithIcon:@"game_center" Title:@"游戏中心"];
    game_center.pushClass =[GWtestView class];
    GWDiscoverItem *near =[GWDiscoverItem itemWithIcon:@"near" Title:@"周边"];
    GWDiscoverItem *app =[GWDiscoverItem itemWithIcon:@"app" Title:@"应用"];
    [app setOperation:^{
        
        NSLog(@"应用------");
    }];
    group.items =@[game_center,near,app];
    [self.itemGroups addObject:group];
}



@end
